$OpenBSD: patch-util_rarian-sk-migrate_cpp,v 1.2 2015/04/17 09:54:10 ajacoutot Exp $

Fix segfault when argc is not fulfilled.

--- util/rarian-sk-migrate.cpp.orig	Mon Sep  1 20:40:21 2008
+++ util/rarian-sk-migrate.cpp	Sun Feb 15 14:31:15 2009
@@ -279,8 +279,14 @@ int main (int argc, char * argv[])
     struct stat buf;
     char *path = NULL;
 
-    if (argc != 3 || access (argv[1], R_OK)) {
+    if (argc == 3) {
+      if (access (argv[1], R_OK) < 0)
         fprintf (stderr, "ERROR: Cannot access directory %s\n", argv[1]);
+	exit (1);
+    }
+    else {
+        fprintf (stderr, "Usage: %s <Input Dir> <Program>\n", argv[0]);
+	exit (1);
     }
 	reg = rrn_reg_new_full ();
 
